#coding:utf-8
from flask import Flask
from flask_sqlalchemy import SQLAlchemy

#generate_password_hash生成加密密码
#check_password_hash生成验证密码
# from werkzeug.security import generate_password_hash,check_password_hash

app=Flask(__name__)
app.debug=True
app.secret_key="\xa1\x80\xee1\xf7\x809\xcb"
db=SQLAlchemy()

def create_app():
    app.config['SQLALCHEMY_DATABASE_URI']='mysql://root:@localhost:3306/test2'
    db.init_app(app)
    #在这里导入路由,然后注册到app
    #从同级目录里面找到main对象
    #防止交叉
    from .main import main 
    app.register_blueprint(main)
    from .auth import auth
    app.register_blueprint(auth)
    
    return app
import model










